﻿@{
    ViewBag.Title = "Index";
}
<script>
    function func(obj)
    {
        var img = document.getElementById("img");
        if (obj.files&&obj.files[0]) {
            var reader = new FileReader();
            reader.onload = function (evt) {

                img.src = evt.target.result;
            }
            reader.readAsDataURL(file.files[0]);
        }

    }
</script>

<div>
    <img id="img" style="height:100px;width:100px;border:1px solid #00bfff" onclick="document.getElementById('file').click()" />
</div>
<input type="file" id="file" style="display:none" onchange="func(this)"/>

